version: '3.8'

services:

  django:
    image: "${DOCKER_NAME}"
    container_name: ${DOCKER_NAME}-django
    command: bash -c "python3.10 manage.py migrate && python3.10 manage.py makemigrations && python3.10 manage.py migrate && python3.10 manage.py runserver 0.0.0.0:${DJANGO_PORT} --nothreading"
    env_file:
        - '.env'
    network_mode: "host"
    volumes:
      - .:/app
    logging:
        options:
          max-size: 10m
          max-file: "3"

  bot:
    container_name: "${DOCKER_NAME}-container"
    stop_signal: SIGINT
    build:
      context: .
    image: ${DOCKER_NAME}
    command: python3.10 app.py
    restart: always
    depends_on:
      - django
    env_file:
      - ".env"
    network_mode: "host"
    logging:
      options:
        max-size: 10m
        max-file: "3"
